<!DOCTYPE html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  
 </head>
 <body>
  <script>
var str = 'abcdeabcde';
console.log(str.indexOf('a'));  	// 返回0
console.log(str.indexOf('a', 3));  	// 返回5
console.log(str.indexOf('bc')); 	// 返回1


  </script>
 </body>
</html>
